Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals

esShapes.c File Reference

#include "esUtil.h"
#include <stdlib.h>
#include <math.h>

Defines

#define ES_PI   (3.14159265f)

Functions

int ESUTIL_API esGenSphere (int numSlices, float radius, GLfloat **vertices, GLfloat **normals, GLfloat **texCoords, GLuint **indices)
 Generates geometry for a sphere. Allocates memory for the vertex data and stores the results in the arrays. Generate index list for a TRIANGLE_STRIP.

int ESUTIL_API esGenCube (float scale, GLfloat **vertices, GLfloat **normals, GLfloat **texCoords, GLuint **indices)
 Generates geometry for a cube. Allocates memory for the vertex data and stores the results in the arrays. Generate index list for a TRIANGLES.


Define Documentation

#define ES_PI   (3.14159265f)
 


Function Documentation

int ESUTIL_API esGenCube float  scale,
GLfloat **  vertices,
GLfloat **  normals,
GLfloat **  texCoords,
GLuint **  indices
 

Generates geometry for a cube. Allocates memory for the vertex data and stores the results in the arrays. Generate index list for a TRIANGLES.

Parameters:
scale The size of the cube, use 1.0 for a unit cube.
vertices If not NULL, will contain array of float3 positions
normals If not NULL, will contain array of float3 normals
texCoords If not NULL, will contain array of float2 texCoords
indices If not NULL, will contain the array of indices for the triangle strip
Returns:
The number of indices required for rendering the buffers (the number of indices stored in the indices array if it is not NULL ) as a GL_TRIANGLE_STRIP

int ESUTIL_API esGenSphere int  numSlices,
float  radius,
GLfloat **  vertices,
GLfloat **  normals,
GLfloat **  texCoords,
GLuint **  indices
 

Generates geometry for a sphere. Allocates memory for the vertex data and stores the results in the arrays. Generate index list for a TRIANGLE_STRIP.

Parameters:
numSlices The number of slices in the sphere
vertices If not NULL, will contain array of float3 positions
normals If not NULL, will contain array of float3 normals
texCoords If not NULL, will contain array of float2 texCoords
indices If not NULL, will contain the array of indices for the triangle strip
Returns:
The number of indices required for rendering the buffers (the number of indices stored in the indices array if it is not NULL ) as a GL_TRIANGLE_STRIP


Generated on Thu Jan 31 11:29:22 2008 for ES Framework by doxygen 1.3.6